package com.cms.acase.Utils

import java.util.ServiceLoader

object ServiceFactory {

    fun <T> loadService(clazz: Class<T>): T? {
        return try {
            ServiceLoader.load(clazz).iterator().next()
        }catch (e:Exception){
            null
        }
    }
}